<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - org.sakaiproject.genericdao.springjdbc.translators.BasicTranslator</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr>  <td class="heading">Classes in this File</td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td>  <td class="heading" width="10%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
  <tr><td class="text"><a href="org.sakaiproject.genericdao.springjdbc.translators.BasicTranslator.html">BasicTranslator</a></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>50%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="50"></td><td class="uncovered" width="50"></td></tr></table></td></tr></table></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>57%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="57"></td><td class="uncovered" width="42"></td></tr></table></td></tr></table></td><td class="value"><span class="hidden">0.0;</span>0</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr>
  <td class="numLine">&nbsp;1</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;2</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $Id: org.sakaiproject.genericdao.springjdbc.translators.BasicTranslator.html 11 2009-01-29 14:58:33Z azeckoski $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;3</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $URL: http://genericdao.googlecode.com/svn/maven/site/cobertura/org.sakaiproject.genericdao.springjdbc.translators.BasicTranslator.html $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;4</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * BasicTranslator.java - genericdao - Apr 26, 2008 1:52:06 PM - azeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;5</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> **************************************************************************</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;6</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Copyright (c) 2008 Aaron Zeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;7</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed under the Apache License, Version 2</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;8</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;9</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * A copy of the Apache License, Version 2 has been included in this </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;10</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;11</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;12</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;13</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;14</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;15</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> org.sakaiproject.genericdao.springjdbc.translators;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;16</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;17</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.annotation.Annotation;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;18</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;19</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ClassFields;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;20</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ReflectUtils;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;21</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.annotations.PersistentTableName;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;22</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.translators.DatabaseTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;23</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;24</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;25</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;26</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * A basic translator class to extend</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;27</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;28</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author Aaron Zeckoski (azeckoski@gmail.com)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;29</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;30</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">abstract</span> <span class="keyword">class</span> BasicTranslator <span class="keyword">implements</span> DatabaseTranslator {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;31</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;32</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;33</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Create a tablename from a given class</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;34</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;35</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String makeTableNameFromClass(Class&lt;?&gt; pClass) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;36</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        String tableName = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;37</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// try to get from class annotations first</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;38</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        ClassFields&lt;?&gt; classFields = ReflectUtils.getInstance().analyzeClass(pClass);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;39</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (classFields.getClassAnnotations().contains(PersistentTableName.<span class="keyword">class</span>)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;40</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">for</span> (Annotation classAnnote : classFields.getClassAnnotations()) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;41</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">if</span> (PersistentTableName.<span class="keyword">class</span>.equals(classAnnote.annotationType())) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;42</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    tableName = ((PersistentTableName)classAnnote).value();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;43</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">break</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;44</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;45</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;46</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;47</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (tableName == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;48</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;            String name = pClass.getSimpleName();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;49</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;            tableName = makeDBNameFromCamelCase(name);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;50</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (tableName.startsWith(<span class="string">"_"</span>) &amp;&amp; tableName.length() &gt; 1) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;51</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;                tableName = tableName.substring(1);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;52</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;53</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;54</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> tableName;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;55</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;56</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;57</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;58</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Create a string that can be used for a DB name that is compatible with most databases (30 chars or less)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;59</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param camelCase a string in camelCase (e.g. someString, MyString)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;60</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a string in DB style (e.g SOME_STRING, _MY_STRING)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;61</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;62</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String makeDBNameFromCamelCase(String camelCase) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;63</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        String dbCase;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;64</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (camelCase.equals(camelCase.toUpperCase())) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;65</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// name is already uppercase</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;66</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            dbCase = camelCase;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;67</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;68</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;            StringBuilder sb = <span class="keyword">new</span> StringBuilder();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;69</td>
  <td class="nbHitsCovered">&nbsp;200</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; camelCase.length(); i++) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;70</td>
  <td class="nbHitsCovered">&nbsp;168</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">char</span> c = camelCase.charAt(i);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;71</td>
  <td class="nbHitsCovered">&nbsp;168</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (Character.isUpperCase(c)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;72</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    sb.append(<span class="string">"_"</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;73</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;74</td>
  <td class="nbHitsCovered">&nbsp;168</td>
  <td class="src"><pre class="src">&nbsp;                sb.append(c);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;75</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;76</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;            dbCase = sb.toString().toUpperCase();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;77</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;78</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> chopString(dbCase, 30);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;79</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;80</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;81</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;82</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dbName a string in DB style (e.g SOME_STRING, MY_STRING, _MY_STRING)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;83</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a string in camelCase (e.g. someString, myString, MyString)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;84</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;85</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String makeCamelCaseFromDBName(String dbName) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;86</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        String camelCase;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;87</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">if</span> (! dbName.equals(dbName.toUpperCase()) </span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;88</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                &amp;&amp; dbName.indexOf(<span class="string">'_'</span>) == -1) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;89</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// name is probably already fine</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;90</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            camelCase = dbName;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;91</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;92</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            StringBuilder sb = <span class="keyword">new</span> StringBuilder();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;93</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            dbName = dbName.toLowerCase();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;94</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; dbName.length(); i++) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;95</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">char</span> c = dbName.charAt(i);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;96</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">if</span> (c == <span class="string">'_'</span>) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;97</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    i++;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;98</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;99</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        c = Character.toUpperCase(dbName.charAt(i));</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;100</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (IndexOutOfBoundsException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;101</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// end of string</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;102</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">break</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;103</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;104</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;105</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                sb.append(c);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;106</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;107</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            camelCase = sb.toString();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;108</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;109</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> camelCase;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;110</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;111</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;112</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;113</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Chop a string to the mexLength if it is longer and return the chopped string</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;114</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param str</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;115</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param maxLength</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;116</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the chopped string</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;117</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;118</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String chopString(String str, <span class="keyword">int</span> maxLength) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;119</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (str == <span class="keyword">null</span> || <span class="string">""</span>.equals(str)) { <span class="keyword">return</span> <span class="string">""</span>; }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;120</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (str.length() &gt; maxLength) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;121</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            str = str.substring(0, 29);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;122</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;123</td>
  <td class="nbHitsCovered">&nbsp;32</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> str;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;124</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;125</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;126</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;}</pre></td>
</tr>
</table>
<div class="footer">
Reports generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a>.
</div>
</body>
</html>
